package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.log.anno.SysOperLog;
import com.atguigu.spzx.manager.service.OrderStatisticsService;
import com.atguigu.spzx.model.vo.common.R;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/admin/order/orderStatistics")
public class OrderStatisticsController {
    @Resource
    OrderStatisticsService orderStatisticsService;
    //aop：环绕通知
//    @SysOperLog
    @Operation(summary = "查询时间区间内的订单统计数据")
    @GetMapping("list/{begin}/{end}")
    public R list(@PathVariable("begin")String begin,
                  @PathVariable("end")String end){

        Map<String,Object> map = orderStatisticsService.list(begin,end);
        return R.ok().data(map);//R.data.key
    }

}
